feat(orchestrator): pass model options through MCP thread targets#3872
feat(orchestrator): pass model options through MCP thread targets#3872PixPMusic wants to merge 2 commits into
Conversation
Delegated tasks and MCP-created threads previously had no way to set the child's model options (reasoning effort, fast mode, ...): target only carried providerInstanceId/driverKind/model and resolveTarget dropped options entirely. Accept canonical and shorthand option selections on every MCP target, validate them against the model's advertised option descriptors, carry them into the child's model selection, and advertise per-model option descriptors in orchestrator_capabilities so agents can discover valid ids and values.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5f5abdf. Configure here.
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. This PR introduces a new feature enabling model options (like reasoning effort) to be passed to child threads through MCP targets. New runtime behavior propagation to previously unaffected code paths warrants human review to verify the design and downstream effects. You can customize Macroscope's approvability policy. Learn more. |
Review follow-ups: the shorthand record form previously reused the legacy-tolerant persistence schema, which silently dropped values that are not strings or booleans instead of failing the request; decode it strictly instead. Duplicate option ids now fail validation regardless of descriptor availability, since downstream consumers disagree on whether the first or last value wins.

The thread orchestrator had no way to pass model options (reasoning effort, variant settings, ...) down to a child thread:
delegate_task/create_threads/t3_thread_starttargets only carriedproviderInstanceId/driverKind/model, andresolveTargetdropped options entirely. Reported by joaquin on Discord while testing the orchestrator v2 branch.target.optionsnow accepts the canonical[{ id, value }]array or the shorthand{ reasoning: "low" }record on every MCP target.invalid_requestlisting the valid choices.{ instanceId, model }).orchestrator_capabilitiesnow advertises per-model option descriptors so agents can discover valid option ids and values before delegating.Covered by contract decode tests (both option shapes) and the orchestrator MCP integration test (options reach the child's model selection; invalid options are rejected before any thread is created; capabilities advertise descriptors).
Note
Medium Risk
Touches orchestration target resolution and child
modelSelectionbehavior on a public MCP surface; risk is mitigated by strict validation and integration/contract tests, with no auth or persistence migration changes.Overview
MCP orchestration targets (
delegate_task,create_threads,t3_thread_start) can now carry model options (e.g. reasoning effort), which previously stopped at provider/model and never reached child threads.Contracts:
OrchestratorMcpTargetgains optionaloptions, decoded as either[{ id, value }]or a shorthand{ id: value }record. Unlike persistence schemas, invalid value types fail decode instead of being dropped. Capability responses expose per-model option descriptors so agents can discover valid ids before delegating.Server:
resolveTargetvalidates options (duplicate ids, unknown ids, boolean/select typing) against the resolved model’s descriptors and returnsinvalid_requestbefore creating a child. Valid options are written into the child’smodelSelection; reusing the parent’s selection object only happens when provider, model, and options are all unchanged.Tool descriptions mention
target.optionsand point agents atorchestrator_capabilities.Reviewed by Cursor Bugbot for commit 45b3605. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Pass model options through MCP orchestrator thread targets with validation
optionsfield toOrchestratorMcpTargetin orchestratorMcp.ts, accepting either a canonicalProviderOptionSelectionarray or a shorthand{ id: value }record form.makegenerator of OrchestratorMcpService.ts against provider-advertised descriptors, rejecting duplicates, unknown ids, type mismatches, and invalid select values with aninvalid_requesterror.modelSelectionrecorded for child threads; inheritance from parent thread now only applies wheninstanceIdandmodelmatch and no options were requested.optionDescriptorsinorchestrator_capabilitiesresponses so clients can discover valid option ids and values.Macroscope summarized 45b3605.